import Layout from 'src/pages/layout/layout';

// 不作为main组件子页面展示的页面单独写，如下
export const loginRouter = {
    path: '/login',
    name: 'login',
    meta: { title: '登录' },
    component: () =>
        import ('src/pages/login/login')
};

// 错误页面
export const errorRouter = {
    path: '/error/:code',
    name: 'error',
    meta: { title: 'error' },
    component: () =>
        import ('src/pages/error/index')
};

// 作为main组件子页面展示  但不在左侧菜单显示的路由卸载otherRoter里
export const otherRouter = {
    path: '',
    name: 'otherRouter',
    redirect: '/home',
    meta: { requireAuth: true },
    component: Layout,
    children: [{
            path: 'home',
            name: 'home',
            title: '首页',
            meta: { title: '首页' },
            component: () =>
                import ('src/pages/home/home')
        },

        {
            path: 'liveManager',
            name: 'liveManager',
            title: '直播管理',
            meta: { title: '直播管理' },
            component: () =>
                import ('src/pages/liveManager/index')
        }, {
            path: 'newLive',
            name: 'newLive',
            title: '新增直播课程',
            meta: { title: '直播课程' },
            component: () =>
                import ('src/pages/liveManager/newLive')
        }, {
            path: 'courseware',
            name: 'courseware',
            title: '课件组',
            meta: { title: '课件组' },
            component: () =>
                import ('src/pages/liveManager/courseware')
        }, {
            path: 'liveColumn',
            name: 'liveColumn',
            title: '直播目录',
            meta: { title: '直播目录' },
            component: () =>
                import ('src/pages/liveManager/liveColumn')
        }, {
            path: 'coursewareLiveWrap',
            name: 'coursewareLiveWrap',
            title: '课件组直播状态',
            meta: { title: '课件组直播状态' },
            component: () =>
                import ('src/pages/liveManager/coursewareLiveWrap')
        }, {
            path: 'satisfaction',
            name: 'satisfaction',
            title: '直播满意度调查',
            meta: { title: '直播满意度调查' },
            component: () =>
                import ('src/pages/liveManager/satisfaction')
        }, {
            path: 'liveData',
            name: 'liveData',
            title: '直播数据',
            meta: { title: '直播数据' },
            component: () =>
                import ('src/pages/liveManager/liveData')
        }, {
            path: 'newLiveColumn',
            name: 'newLiveColumn',
            title: '添加直播',
            meta: { title: '添加直播' },
            component: () =>
                import ('src/pages/liveManager/newLiveColumn')
        }, {
            path: 'coursewareComment',
            name: 'coursewareComment',
            title: '课件评论',
            meta: { title: '课件评论' },
            component: () =>
                import ('src/pages/liveManager/coursewareComment')
        }, {
            path: 'coursewareSign',
            name: 'coursewareSign',
            title: '课件报名',
            meta: { title: '课件报名' },
            component: () =>
                import ('src/pages/liveManager/coursewareSign')
        }, {
            path: 'liveColumnSign',
            name: 'liveColumnSign',
            title: '直播目录报名',
            meta: { title: '直播目录报名' },
            component: () =>
                import ('src/pages/liveManager/liveColumnSign')
        }, {
            path: 'liveWinners',
            name: 'liveWinners',
            title: '获奖名单',
            meta: { title: '获奖名单' },
            component: () =>
                import ('src/pages/liveManager/liveWinners')
        }, {
            path: 'liveDataType',
            name: 'liveDataType',
            title: '直播数据',
            meta: { title: '直播数据' },
            component: () =>
                import ('src/pages/liveManager/liveDataType')
        }, {
            path: 'liveDataColumn',
            name: 'liveDataColumn',
            title: '直播数据',
            meta: { title: '直播数据' },
            component: () =>
                import ('src/pages/liveManager/liveDataColumn')
        }, {
            path: 'homework',
            name: 'homework',
            title: '添加作业',
            meta: { title: '添加作业' },
            component: () =>
                import ('src/pages/liveManager/homework')
        }, {
            path: 'homeworkStatus',
            name: 'homeworkStatus',
            title: '状态管理',
            meta: { title: '状态管理' },
            component: () =>
                import ('src/pages/liveManager/homeworkStatus')
        }, {
            path: 'video',
            name: 'video',
            title: '添加视频',
            meta: { title: '添加视频' },
            component: () =>
                import ('src/pages/liveManager/video')
        }, {
            path: 'file',
            name: 'file',
            title: '添加文件',
            meta: { title: '添加文件' },
            component: () =>
                import ('src/pages/liveManager/file')
        },


        {
            path: 'taskManager',
            name: 'taskManager',
            title: '课程任务管理',
            meta: { title: '课程任务管理' },
            component: () =>
                import ('src/pages/courseTask/taskManager')
        }, {
            path: 'createTask',
            name: 'createTask',
            title: '添加课程任务',
            meta: { title: '添加课程任务' },
            component: () =>
                import ('src/pages/courseTask/createTask')
        },


        {
            path: 'createWare',
            name: 'createWare',
            title: '创建课件',
            meta: { title: '创建课件' },
            component: () =>
                import ('src/pages/networkManagement/createWare')
        }, {
            path: 'knowledgeMapRec',
            name: 'knowledgeMapRec',
            title: '知识地图首页推荐',
            meta: { title: '知识地图首页推荐' },
            component: () =>
                import ('src/pages/networkManagement/knowledgeMapRec')
        }, {
            path: 'dynamicContent',
            name: 'dynamicContent',
            title: '动态内容',
            meta: { title: '动态内容' },
            component: () =>
                import ('src/pages/networkManagement/dynamicContent')
        }, {
            path: 'topicContent',
            name: 'topicContent',
            title: '话题内容',
            meta: { title: '话题内容' },
            component: () =>
                import ('src/pages/networkManagement/topicContent')
        }, {
            path: 'topicCommentList',
            name: 'topicCommentList',
            title: '话题跟帖',
            meta: { title: '话题跟帖' },
            component: () =>
                import ('src/pages/networkManagement/topicCommentList')
        }, {
            path: 'topicCommentContent',
            name: 'topicCommentContent',
            title: '跟帖内容',
            meta: { title: '跟帖内容' },
            component: () =>
                import ('src/pages/networkManagement/topicCommentContent')
        }, {
            path: 'topicAuditList',
            name: 'topicAuditList',
            title: '话题审核',
            meta: { title: '话题审核' },
            component: () =>
                import ('src/pages/networkManagement/topicAuditList')
        }, {
            path: 'activityContent',
            name: 'activityContent',
            title: '活动内容',
            meta: { title: '活动内容' },
            component: () =>
                import ('src/pages/networkManagement/activityContent')
        }, {
            path: 'activitySign',
            name: 'activitySign',
            title: '活动报名',
            meta: { title: '活动报名' },
            component: () =>
                import ('src/pages/networkManagement/activitySign')
        }, {
            path: 'activityAuditList',
            name: 'activityAuditList',
            title: '活动审核',
            meta: { title: '活动审核' },
            component: () =>
                import ('src/pages/networkManagement/activityAuditList')
        }, {
            path: 'topicClassify',
            name: 'topicClassify',
            title: '话题分类',
            meta: { title: '话题分类' },
            component: () =>
                import ('src/pages/networkManagement/topicClassify')
        }, {
            path: 'studyMapClassify',
            name: 'studyMapClassify',
            title: '分类管理',
            meta: { title: '分类管理' },
            component: () =>
                import ('src/pages/networkManagement/studyMapClassify')
        },


        {
            path: 'teacher',
            name: 'teacher',
            title: '讲师管理',
            meta: { title: '讲师管理' },
            component: () =>
                import ('src/pages/teacher/teacher')
        }, {
            path: 'levelJs',
            name: 'levelJs',
            title: '讲师等级',
            meta: { title: '讲师等级' },
            component: () =>
                import ('src/pages/teacher/levelJs')
        }, {
            path: 'labelJs',
            name: 'labelJs',
            title: '讲师标签',
            meta: { title: '讲师标签' },
            component: () =>
                import ('src/pages/teacher/labelJs')
        }, {
            path: 'rankJs',
            name: 'rankJs',
            title: '讲师榜',
            meta: { title: '讲师榜' },
            component: () =>
                import ('src/pages/teacher/rankJs')
        }, {
            path: 'edithomework',
            name: 'edithomework',
            title: '编辑讲师作业',
            meta: { title: '编辑讲师作业' },
            component: () =>
                import ('src/pages/teacher/edithomework')
        }, {
            path: 'teacherCourse',
            name: 'teacherCourse',
            title: '讲师新增课程',
            meta: { title: '讲师新增课程' },
            component: () =>
                import ('src/pages/teacher/teacherCourse')
        }, {
            path: 'teacherLive',
            name: 'teacherLive',
            title: '讲师直播课程',
            meta: { title: '讲师直播课程' },
            component: () =>
                import ('src/pages/teacher/teacherLive')
        }, {
            path: 'teacherMap',
            name: 'teacherMap',
            title: '讲师知识地图',
            meta: { title: '讲师知识地图' },
            component: () =>
                import ('src/pages/teacher/teacherMap')
        }, {
            path: 'tCourseList',
            name: 'tCourseList',
            title: '讲师课程',
            meta: { title: '讲师课程' },
            component: () =>
                import ('src/pages/teacher/tCourseList')
        }, {
            path: 'createTeacherWare',
            name: 'createTeacherWare',
            title: '创建课件',
            meta: { title: '创建课件' },
            component: () =>
                import ('src/pages/teacher/createTeacherWare')
        }, {
            path: 'teacherHomework',
            name: 'teacherHomework',
            title: '讲师作业',
            meta: { title: '讲师作业' },
            component: () =>
                import ('src/pages/teacher/teacherHomework')
        }, {
            path: 'teacherhomeworkStatus',
            name: 'teacherhomeworkStatus',
            title: '讲师作业',
            meta: { title: '讲师作业' },
            component: () =>
                import ('src/pages/teacher/teacherhomeworkStatus')
        }, {
            path: 'soTeacher',
            name: 'soTeacher',
            title: 'soTeacher - 课程列表',
            meta: { title: '课程列表' },
            component: () =>
                import ('src/pages/add/soTeacher')
        },


        {
            path: 'createAuditGrope',
            name: 'createAuditGrope',
            title: '创建审核小组',
            meta: { title: '创建审核小组' },
            component: () =>
                import ('src/pages/organization/createAuditGrope')
        }, {
            path: 'userLive',
            name: 'userLive',
            title: '用户直播课程',
            meta: { title: '用户直播课程' },
            component: () =>
                import ('src/pages/user/userLive')
        }, {
            path: 'userLiveData',
            name: 'userLiveData',
            title: '用户直播数据',
            meta: { title: '用户直播数据' },
            component: () =>
                import ('src/pages/user/userLiveData')
        }, {
            path: 'recordedData',
            name: 'recordedData',
            title: '学员录播数据',
            meta: { title: '学员录播数据' },
            component: () =>
                import ('src/pages/user/recordedData')
        }, {
            path: 'userKnowledgeMap',
            name: 'userKnowledgeMap',
            title: '学员地图',
            meta: { title: '学员地图' },
            component: () =>
                import ('src/pages/user/userKnowledgeMap')
        }, {
            path: 'userHomework',
            name: 'userHomework',
            title: '学员作业',
            meta: { title: '学员作业' },
            component: () =>
                import ('src/pages/user/userHomework')
        }, {
            path: 'userComment',
            name: 'userComment',
            title: '学员课程评论',
            meta: { title: '学员课程评论' },
            component: () =>
                import ('src/pages/user/userComment')
        }, {
            path: 'userTask',
            name: 'userTask',
            title: '学员学习任务',
            meta: { title: '学员学习任务' },
            component: () =>
                import ('src/pages/user/userTask')
        }, {
            path: 'createUser',
            name: 'createUser',
            title: '新增用户',
            meta: { title: '新增用户' },
            component: () =>
                import ('src/pages/organization/createUser')
        }, {
            path: 'userStudyData',
            name: 'userStudyData',
            title: '学员学习数据',
            meta: { title: '学员学习数据' },
            component: () =>
                import ('src/pages/user/userStudyData')
        },
        {
            path: 'userMsg',
            name: 'userMsg',
            title: '用户信息',
            meta: { title: '用户信息' },
            component: () =>
                import ('src/pages/organization/userMsg')
        },
        {
            path: 'creditRecord',
            name: 'creditRecord',
            title: '学分记录',
            meta: { title: '学分记录' },
            component: () =>
                import ('src/pages/organization/creditRecord')
        },
        {
            path: 'test',
            name: 'test',
            title: 'test',
            meta: { title: 'test' },
            component: () =>
                import ('src/pages/organization/test')
        },

        {
            path: 'addsub',
            name: 'addsub',
            title: 'addsub - 新增课程',
            meta: { title: '新增课程' },
            component: () =>
                import ('src/pages/add/addsub')
        }, {
            path: 'addcomment',
            name: 'addcomment',
            title: 'addcomment - 课程评论',
            meta: { title: '课程评论' },
            component: () =>
                import ('src/pages/add/addcomment')
        }, {
            path: 'addtuijian',
            name: 'addtuijian',
            title: 'addtuijian - 新增推荐',
            meta: { title: '新增推荐' },
            component: () =>
                import ('src/pages/add/addtuijian')
        }, {
            path: 'addlecture',
            name: 'addlecture',
            title: 'addlecture - 活动讲座',
            meta: { title: '活动讲座' },
            component: () =>
                import ('src/pages/add/addlecture')
        }, {
            path: 'addconsult',
            name: 'addconsult',
            title: 'addconsult - 活动推荐列表',
            meta: { title: '活动推荐列表' },
            component: () =>
                import ('src/pages/add/addconsult')
        }, {
            path: 'addbanner',
            name: 'addbanner',
            title: 'addbanner - 添加轮播图',
            meta: { title: '添加轮播图' },
            component: () =>
                import ('src/pages/add/addbanner')
        }, {
            path: 'addnews',
            name: 'addnews',
            title: 'addnews - 新增资讯',
            meta: { title: '新增资讯' },
            component: () =>
                import ('src/pages/add/addnews')
        }, {
            path: 'addcolumn',
            name: 'addcolumn',
            title: 'addcolumn - 添加栏目',
            meta: { title: '添加栏目' },
            component: () =>
                import ('src/pages/add/addcolumn')
        }, {
            path: 'addteacher',
            name: 'addteacher',
            title: 'addteacher - 新增讲师',
            meta: { title: '新增讲师' },
            component: () =>
                import ('src/pages/add/addteacher')
        }, {
            path: 'addGoods',
            name: 'addGoods',
            title: 'addGoods - 添加商品',
            meta: { title: '添加商品' },
            component: () =>
                import ('src/pages/add/addGoods')
        }, {
            path: 'addImg',
            name: 'addImg',
            title: 'addImg - 添加图片',
            meta: { title: '添加图片' },
            component: () =>
                import ('src/pages/add/addImg')
        }, {
            path: '/signIn',
            name: 'signIn',
            title: 'signIn - 报名管理',
            meta: { title: '报名管理' },
            component: () =>
                import ('src/pages/add/signIn')
        },


        {
            path: '/rule',
            name: 'rule',
            title: 'rule - 学分规则',
            meta: { title: '学分规则' },
            component: () =>
                import ('src/pages/set/rule')
        }, {
            path: '/detail',
            name: 'detail',
            title: 'detail - 学分明细',
            meta: { title: '学分明细' },
            component: () =>
                import ('src/pages/set/detail')
        }, {
            path: '/newAdmin',
            name: 'newAdmin',
            title: 'newAdmin - 新增管理员',
            meta: { title: '新增管理员' },
            component: () =>
                import ('src/pages/set/newAdmin')
        }, {
            path: '/btnManager',
            name: 'btnManager',
            title: 'btnManager - 按钮管理',
            meta: { title: '按钮管理' },
            component: () =>
                import ('src/pages/set/btnManager')
        }, {
            path: 'createXieyi',
            name: 'createXieyi',
            title: '创建协议',
            meta: { title: '创建协议' },
            component: () =>
                import ('src/pages/set/createXieyi')
        },


        {
            path: '/permissionsControl',
            name: 'permissionsControl',
            title: '权限管理',
            meta: { title: '按钮管理' },
            component: () =>
                import ('src/pages/permissionsControl/permissionsControl')
        }, {
            path: 'optimizeAlert',
            name: 'optimizeAlert',
            title: '优化弹窗',
            component: () =>
                import ('src/components/optimizeAlert')
        }
    ]
};









// 作为Main组件的子页面展示并且在左侧菜单显示的路由写在appRouter里
export const appRouter = [{
    path: '/subject',
    name: 'subject',
    title: '课程中心',
    meta: { requireAuth: true },
    component: Layout,
    children: [{
        path: 'manager',
        name: 'manager',
        title: '课程管理',
        meta: { title: '课程管理' },
        component: () =>
            import ('src/pages/subject/manager')
    }, {
        path: 'KcAudit',
        name: 'KcAudit',
        title: '课程审核',
        meta: { title: '课程审核' },
        component: () =>
            import ('src/pages/subject/KcAudit')
    }, {
        path: 'tuijian',
        name: 'tuijian',
        title: '课程推荐',
        meta: { title: '课程推荐' },
        component: () =>
            import ('src/pages/subject/tuijian')
    }, {
        path: 'news',
        name: 'news',
        title: '新闻资讯',
        meta: { title: '新闻资讯' },
        component: () =>
            import ('src/pages/subject/news')
    }, {
        path: 'lecture',
        name: 'lecture',
        title: '活动讲座',
        meta: { title: '活动讲座' },
        component: () =>
            import ('src/pages/subject/lecture')
    }, {
        path: 'labelKc',
        name: 'labelKc',
        title: '课程标签',
        meta: { title: '课程标签' },
        component: () =>
            import ('src/pages/subject/labelKc')
    }, {
        path: 'rankKc',
        name: 'rankKc',
        title: '课程榜',
        meta: { title: '课程榜' },
        component: () =>
            import ('src/pages/subject/rankKc')
    }]
}, {
    path: '/networkManagement',
    title: '圈子管理',
    meta: { requireAuth: true },
    component: Layout,
    children: [{
        path: 'studyMap',
        name: 'studyMap',
        title: '学习地图',
        meta: { title: '学习地图' },
        component: () =>
            import ('src/pages/networkManagement/studyMap')
    }, {
        path: 'dynamicManager',
        name: 'dynamicManager',
        title: '动态管理',
        meta: { title: '动态管理' },
        component: () =>
            import ('src/pages/networkManagement/dynamicManager')
    }, {
        path: 'topicManager',
        name: 'topicManager',
        title: '话题管理',
        meta: { title: '话题管理' },
        component: () =>
            import ('src/pages/networkManagement/topicManager')
    }, {
        path: 'activityManager',
        name: 'activityManager',
        title: '活动管理',
        meta: { title: '活动管理' },
        component: () =>
            import ('src/pages/networkManagement/activityManager')
    }]
}, {
    path: '/organization',
    title: '组织用户',
    meta: { requireAuth: true },
    component: Layout,
    children: [{
        path: 'userManager',
        name: 'userManager',
        title: '用户管理',
        meta: { title: '用户管理' },
        component: () =>
            import ('src/pages/organization/userManager')
    }, {
        path: 'userAudit',
        name: 'userAudit',
        title: '用户审核',
        meta: { title: '用户审核' },
        component: () =>
            import ('src/pages/organization/userAudit')
    }, {
        path: 'orgManager',
        name: 'orgManager',
        title: '组织管理',
        meta: { title: '组织管理' },
        component: () =>
            import ('src/pages/organization/orgManager')
    }, {
        path: 'userClassification',
        name: 'userClassification',
        title: '用户分类',
        meta: { title: '用户分类' },
        component: () =>
            import ('src/pages/organization/userClassification')
    }, {
        path: 'jobsManager',
        name: 'jobsManager',
        title: '岗位管理',
        meta: { title: '岗位管理' },
        component: () =>
            import ('src/pages/organization/jobsManager')
    }, {
        path: 'labelYh',
        name: 'labelYh',
        title: '用户标签',
        meta: { title: '用户标签' },
        component: () =>
            import ('src/pages/organization/labelYh')
    }, {
        path: 'levelYh',
        name: 'levelYh',
        title: '用户等级',
        meta: { title: '用户等级' },
        component: () =>
            import ('src/pages/organization/levelYh')
    }, {
        path: 'rankYh',
        name: 'rankYh',
        title: '学员榜',
        meta: { title: '学员榜' },
        component: () =>
            import ('src/pages/organization/rankYh')
    }, {
        path: 'auditManager',
        name: 'auditManager',
        title: '审核组管理',
        meta: { title: '审核组管理' },
        component: () =>
            import ('src/pages/organization/auditManager')
    }]
}, {
    path: '/mall',
    name: 'mall',
    title: '商城管理',
    meta: { requireAuth: true },
    component: Layout,
    children: [{
        path: 'goods',
        name: 'goods',
        title: '商品管理',
        meta: { title: '商品管理' },
        component: () =>
            import ('src/pages/mall/goods')
    }, {
        path: 'recommend',
        name: 'recommend',
        title: '推荐管理',
        meta: { title: '推荐管理' },
        component: () =>
            import ('src/pages/mall/recommend')
    }, {
        path: 'exchange',
        name: 'exchange',
        title: '兑换管理',
        meta: { title: '兑换管理' },
        component: () =>
            import ('src/pages/mall/exchange')
    }]
}, {
    path: '/set',
    title: '综合设置',
    meta: { requireAuth: true },
    component: Layout,
    children: [{
        path: 'banner',
        name: 'banner',
        title: '首页滚动图',
        meta: { title: '首页滚动图' },
        component: () =>
            import ('src/pages/set/banner')
    }, {
        path: 'column',
        name: 'column',
        title: '栏目管理',
        meta: { title: '栏目管理' },
        component: () =>
            import ('src/pages/set/column')
    }, {
        path: 'set',
        name: 'set',
        title: '账号设置',
        meta: { title: '账号设置' },
        component: () =>
            import ('src/pages/set/set')
    }, {
        path: 'about',
        name: 'about',
        title: '关于我们',
        meta: { title: '关于我们' },
        component: () =>
            import ('src/pages/set/about')
    }, {
        path: 'fankui',
        name: 'fankui',
        title: '意见反馈',
        meta: { title: '意见反馈' },
        component: () =>
            import ('src/pages/set/fankui')
    }, {
        path: 'version',
        name: 'version',
        title: '版本管理',
        meta: { title: '版本管理' },
        component: () =>
            import ('src/pages/set/version')
    }, {
        path: 'xieyi',
        name: 'xieyi',
        title: '用户协议',
        meta: { title: '用户协议' },
        component: () =>
            import ('src/pages/set/xieyi')
    }, {
        path: 'imgGuanli',
        name: 'imgGuanli',
        title: '图片管理',
        meta: { title: '图片管理' },
        component: () =>
            import ('src/pages/set/imgGuanli')
    }, {
        path: 'log',
        name: 'log',
        title: '操作日志',
        meta: { title: '操作日志' },
        component: () =>
            import ('src/pages/set/log')
    }, {
        path: 'menu',
        name: 'menu',
        title: '菜单管理',
        meta: { title: '菜单管理' },
        component: () =>
            import ('src/pages/set/menu')
    }]
}];

export const routers = [
    loginRouter,
    errorRouter,
    otherRouter,
    ...appRouter
];
